const fetchContent = async function (items) {
    for (var p in items) {
        let response = await fetch(items[p].file);
        let data = await response.text();
        document.getElementById(items[p].id).innerHTML = data;
    }
}

function toggle(id) { 
    let obj = document.getElementById(id); 
    if (obj === null) { 
        return; 
    } 
    if (obj.style.visibility === "visible") { 
        obj.style.visibility = "hidden"; 
    } else { 
        obj.style.visibility = "visible"; 
    } 
}

function CreateMasterStudents(students) {
    const TStudent = '<img src="">\
        <div>{{姓名}}<span>{{年级}}</span></div>\
        <div>{{研究方向}}</div>\
        <div>{{毕业论文}}</div>\
        <div><a href="{{个人主页}}"></a><a href="{{邮箱}}"></a></div>\
        <div>{{毕业去向}}</div>';

}

function CreateUndergraduates(students) {
    const TStudent = '<li> \
        <img src="">\
        <div>{{姓名}}<a href="{{个人主页}}"></a><a href="{{邮箱}}"></a></div>\
        <div><span>{{专业}}</span><span>{{年级}}</span>\
        <div>{{毕业去向}}</div>';
    const ul = document.createElement("ul");
    ul.classList.add("undergraduates");
    for(var student of students) {

    }
}